
<%var csstpl = {%>
    <link href="${basepath}/vendor/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="${basepath}/vendor/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${basepath}/vendor/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="${basepath}/vendor/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="${basepath}/vendor/script/select2/css/select2.css" rel="stylesheet">
    <style>
    	* { outline:none; }
    	li { list-style:none; }
    	body { overflow-x:visible; }
    	.hide { display:none; }
    	.clear { clear:both; margin:0; }
    	.nav-tabs li a { min-width:300px; background:#fbfbfb; color:#555; text-align:center; border: 1px solid #e7eaec; }
    	.tabs-container .nav-tabs>li a:hover { background:#fff; border: 1px solid #e7eaec; }

    	table.page { width:100%; }
    	table.page td { padding:20px; background:#f8f8f8; border: 2px solid #fff; vertical-align:top; }
    	table.page td.tb_title { width:280px; padding-top:27px; font:bold 14px/1em "微软雅黑"; color:#333; text-align:center; }
    	table.page td.btns { text-align:center; }

    	table.store { width:100%; border: 1px solid #e5e5e5; }
    	table.store td { padding:10px; background:#fff; border: 1px solid #e5e5e5; vertical-align:middle; }
    	table.store td img { width:40px; cursor:pointer; }
    	table.store td input { width:60px; padding:5px; border:1px solid #ddd; border-radius:5px; }
    	table.store td.btns { text-align:center; }
    	table.store tr.setting td { background:#fcfcfc !important; border-left:none; border-right:none; }

    	.form-group .radio input { display:none; }
    	.form-group .radio i { display:block; width:20px; height:20px; position:absolute; left:15px; top:6px; background:url(${basepath}/vendor/css/plugins/iCheck/green.png) -120px 0; }
    	.form-group .radio:hover i { background:url(${basepath}/vendor/css/plugins/iCheck/green.png) -144px 0; }
    	.form-group .radio.active i { background:url(${basepath}/vendor/css/plugins/iCheck/green.png) -168px 0; }
    	.form-group .form-control  { border-radius:5px; width:210px; }
    	.form-group .descp { position:absolute; left:240px; top:10px; }
    	.chosen-choices2 { border-radius:3px !important; border:1px solid #e5e6e7 !important; }
    	.chosen-single2  { border-radius:3px !important; border:1px solid #e5e6e7 !important; }

    	.pro_norms ul { padding:0; background:#fff; border:1px solid #e5e5e5; border-radius:5px; }
    	.pro_norms ul li { position:relative; min-height:50px; margin-bottom:-1px; padding:10px 60px 10px 220px; list-style:none inside; border-bottom:1px solid #e5e5e5; }
    	.pro_norms ul li .btn_delitem { position:absolute; right:0px; top:10px; }
    	.pro_norms ul li .btn_additem { position:absolute; left:0px; top:10px; }
    	.pro_norms ul li .btn_add { float:left; }
    	.pro_norms ul li .select2 { position:absolute; left:10px; }
    	.pro_norms ul li select { width:200px; }
    	.pro_norms ul li .item { position:relative; float:left; min-width:120px; margin-right:10px; padding:5px; text-align:center; border:1px solid #e5e5e5; border-radius:5px; }
    	.pro_norms ul li .item .btn_del { float:right; width:25px; height:15px; margin-left:5px; background:url(${basepath}/vendor/img/delete.png) no-repeat center; border-left:1px solid #e5e5e5; cursor:pointer; opacity:0.6; }
    	.pro_norms ul li .item .btn_del:hover { opacity:1; }
        .pro_norms ul li a {color: #337ab7;}

    	.norm_contt select { width:100%; }
    	.norm_panel select { width:100%; }
    	.select2-dropdown { z-index:1000000000; }
    	.error { border:1px solid #f33 !important; }
    	.switch { margin-top:5px; }

    	.pro_pic .pic { position:relative; margin:0 0 15px; padding:0; }
    	.pro_pic .pic:after { display:block; content:""; clear:both; }
		.pro_pic .pic li { position:relative; float:left; margin-right:5px; }
		.pro_pic .pic li b { position:absolute; right:-8px; top:-8px; z-index:5; display:block; width:26px; height:26px; background:#fff; border-radius:50%; cursor:pointer; }
		.pro_pic .pic li b img { position:absolute; left:2px; bottom:2px; display:block; width:22px; height:22px; }
		.pro_pic .pic li input { display:none; }
		.pro_pic .pic li img { width:80px; height:80px; border-radius:5px; opacity:0.9; }
		.pro_pic .pic .btn_add { cursor:pointer; }
		.pro_pic .pic .btn_add:active:after { border:1px solid #bbb; background:rgba(0,0,0,0.03); }
		.pro_pic .clear { line-height:40px; }

		.pro_banner .pic { position:relative; margin:0 0 15px; padding:0; }
    	.pro_banner .pic:after { display:block; content:""; clear:both; }
		.pro_banner .pic li { position:relative; float:left; margin:0 5px 5px 0; }
		.pro_banner .pic li b { position:absolute; right:-8px; top:-8px; z-index:5; display:block; width:26px; height:26px; background:#fff; border-radius:50%; cursor:pointer; }
		.pro_banner .pic li b img { position:absolute; left:2px; bottom:2px; display:block; width:22px; height:22px; }
		.pro_banner .pic li input { display:none; }
		.pro_banner .pic li img { width:150px; height:80px; border-radius:5px; opacity:0.9; }
		.pro_banner .pic .btn_add { cursor:pointer; }
		.pro_banner .pic .btn_add:active:after { border:1px solid #bbb; background:rgba(0,0,0,0.03); }
		.pro_banner .pic .btn_add img { width:80px; }
		.pro_banner .clear { line-height:40px; }

		.pro_pic2 .pic { position:relative; margin:0 0 15px; padding:0; }
    	.pro_pic2 .pic:after  { display:block; content:""; clear:both; }
		.pro_pic2 .pic li { position:relative; float:left; margin:0 5px 5px 0; }
		.pro_pic2 .pic li b { position:absolute; right:-8px; top:-8px; z-index:5; display:block; width:26px; height:26px; background:#fff; border-radius:50%; cursor:pointer; }
		.pro_pic2 .pic li b img { position:absolute; left:2px; bottom:2px; display:block; width:22px; height:22px; }
		.pro_pic2 .pic li input { display:none; }
		.pro_pic2 .pic li img { width:80px; height:80px; border-radius:5px; opacity:0.9; }
		.pro_pic2 .pic .btn_add { cursor:pointer; }
		.pro_pic2 .pic .btn_add:active:after { border:1px solid #bbb; background:rgba(0,0,0,0.03); }
		.pro_pic2 .clear { line-height:40px; }

		.panel2 h2 { font:30px/1em "微软雅黑"; color:#999; text-align:center; padding:200px 0; }
		.pro_recommend div { position:relative; }
		.pro_recommend textarea { width:210px; max-width:210px; min-height:8em; }
		.pro_recommend p { position:absolute; left:240px; top:10px; }
		.pro_percent div  { position:relative; }
		.pro_percent span { position:absolute; left:240px; top:10px; }


		/* 相册 */
		.hide3 * { opacity:0; }
		.album_panel .layui-layer-title   { background:#fff !important; padding-left:12px !important; }
		.album_panel .layui-layer-content { height:100% !important; padding:0 0 0 0px !important; border-bottom:0px solid #f00; }

		.menu { position:absolute; left:0; width:200px; height:100%; background:#f7f7f7; overflow:auto; border-right:1px solid #eaeaea; }
    	.menu ul { padding:0; margin:0; }
    	.menu ul li { position:relative; padding:12px 50px 12px 12px; font:14px/20px "微软雅黑"; cursor:pointer; border-bottom:1px solid #eaeaea; }
    	.menu ul li span { position:absolute; right:12px; top:12px; }
    	.menu ul li.active { background:#fff; }
    	.menu ul li:hover  { background:#fefefe; }

    	.imgs { position:relative; margin-left:200px; border:0px solid #f00; }
    	.imgs.empty { background:url(/static/vendor/img/img_empty.png) no-repeat center; }
    	.imgs ul { padding:5px; border:0px solid #f00; }
    	.imgs ul li { float:left; padding:5px; width:130px; }
    	.imgs ul li div { position:relative; width:120px; height:120px; }
    	.imgs ul li div p { position:absolute; left:0; bottom:0; width:100%; color:#fff; background:rgba(0,0,0,0.3); }
    	.imgs ul li div b { display:none; position:absolute; left:0; top:0; z-index:5; width:116px; height:116px; border:2px solid #6ec174; box-sizing:content-box; cursor:pointer; }
    	.imgs ul li.selected b { display:block; background:url(/static/vendor/img/album_check.png) no-repeat right bottom; }
    	.imgs ul li img { width:100%; height:100%; cursor:pointer; }
    	.imgs ul li p { font:12px/20px "微软雅黑"; margin:5px 0 0; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    	.imgs > div { position:absolute; right:12px; bottom:-39px; overflow:hidden; }  /* 七牛图片上传，btn 外面自动包裹一层 div */
    	.imgs .btn { font:12px/26px "微软雅黑"; color:#fff; padding:0 12px; background:#44BB00; border:1px solid #399f00; border-radius:2px; }
    	.imgs .btn:hover { background:#399f00; }

    	#pagination { height:50px; padding:12px 0 0 210px; border-top:1px solid #eee; }

    	.album_panel .footer { position:relative; height:60px; margin:0; padding:0; background:#fff; }
    	.album_panel .footer .tip { display:none; position:absolute; left:20px; top:20px; font:14px/20px "微软雅黑"; color:#f26e67; }
    	.album_panel .footer .btn { display:block; width:150px; margin:13px auto; padding:5px; background:#337AB7; color:#fff; }
    	.album_panel .footer .btn:active { background:#1a6ea4; }


    	.n-msg{
    	color: red !important;
    	}

    	.width-adaptive{
    	width: 100% !important;
    	}
    	.margin-negative-15{
    	margin-left: -15px !important;
    	}
    </style>
<%};%>
<%var jstpl = {%>
	<script>
        //
	    var product_key = '${product_key}';
	    var norm_01 = JSON.parse(product_key);
	    var norm_02 = {};
	    var norm_03 = {};

	    var product_value='${product_value}';
	    //alert(product_value);
		/* norm_01 = {"10001":"颜色","10002":"尺寸","10003":"款式","10004":"种类","10005":"容量"};
		norm_02 = {"10002":"尺寸","10003":"款式","10004":"种类","10005":"容量"};
		norm_03 = {"10003":"款式","10004":"种类","10005":"容量"}; */
		params=JSON.parse(product_value);
		Console(params);
		 /*params = {
			"10001":{"1000101":"黑色","1000102":"红色","1000103":"绿色"},
			"10002":{"1000201":"S","1000202":"M","1000203":"L"},
			"10003":{"1000301":"时尚","1000302":"优雅"},
			"10004":{},
			"10005":{}
		}; */
		var sku_thumb = {};
	</script>
<!-- 
    <script src="${basepath}/plug/dist/jquery.validate.min.js"></script>
    <script src="${basepath}/plug/dist/localization/messages_zh.js"></script> -->
    <script src="${basepath}/plugin/qn_jssdk/plupload/plupload.full.min.js"></script>
    <script src="${basepath}/plugin/qn_jssdk/qiniu.dev.js"></script>
<!-- <script src="${basepath}/plug/ueditor-min-1.4.3/ueditor.config.js"></script>
	<script src="${basepath}/plug/ueditor-min-1.4.3/ueditor.all.min.js?v=0"> </script>
	<script src="${basepath}/plug/ueditor-min-1.4.3/lang/zh-cn/zh-cn.js"></script> -->
    <script src="${basepath}/plugin/ueditor-min-1.4.3/ueditor.config.js"></script>
    <script src="${basepath}/plugin/ueditor-min-1.4.3/ueditor.all.min.js?v=0"></script>
    <script src="${basepath}/vendor/js/plugins/iCheck/icheck.min.js"></script>
    <script src="${basepath}/vendor/js/plugins/chosen/chosen.jquery.js"></script>
    <script src="${basepath}/vendor/js/plugins/jquery-ui/jquery-ui.min.js"></script>
    <script src="${basepath}/vendor/script/select2/js/select2.js"></script>
    <script src="/static/vendor/script/product_add.js?v=${s_ver!}122"></script>
    <script src="${basepath}/vendor/script/product.js?v=${s_ver!}125"></script>
    <script src="${basepath}/plugin/hhFolder/hhFolder.min.js?a=1"></script>
    <script>
       var is_qd_show=${is_qd_show!};

    //编辑框
    $(function(){


        var ue = UE.getEditor('introduce', {
            autoHeightEnabled: true,
            initialFrameHeight: 500,
            zIndex: 1
        });
    	  var start={elem:"#startTime",
    				format:"YYYY-MM-DD hh:00:00",
    				max:"2099-06-16 23:59:59",
    				min:laydate.now(0, "YYYY/MM/DD hh:00:00"),
    				istime:true,istoday:false,
    				choose:function(datas)
    				{
    					$('#startTime').isValid(function(v){});
    					end.min=datas;end.start=datas}};

    		var end={elem:"#endTime",format:"YYYY-MM-DD hh:00:00",
    				min:laydate.now(0, "YYYY/MM/DD hh:00:00"),
    				max:"2099-06-16 23:59:59",
    				istime:true,istoday:false,
    				choose:function(datas)
    				{
					$('#endTime').isValid(function(v){});
    				start.max=datas}
    			};
    			laydate(start);
    			laydate(end);

            var tail_time={
                elem:"#tailTime",
                format:"YYYY-MM-DD",
                min:laydate.now(1, "YYYY/MM/DD"),
                istoday:false,
                choose:function(datas){
                    $('#tailTime').isValid(function(v){});
                }
            }
            laydate(tail_time);

    $("#attr_type").on("change",function(){
    		if($(this).val()==""){
    			$(".div-hide-group").hide();
				$(".td-hide").hide();
				$(".div-hide-rush-buy").hide();
                if(is_qd_show==1){
                    $(".div-qd-hide-group").hide();
                }else{
                    $(".div-qd-hide-group").show();
                }
    		}else if($(this).val()==1){
    			$(".div-hide-group input").val("");
    			$(".td-hide input").val("");
    			$(".div-hide-rush-buy").hide();
    			$(".div-hide-group").hide();
				$(".td-hide").hide();
                $(".div-qd-hide-group").show();
    		}else if($(this).val()==2){
    			$(".div-hide-rush-buy input").val("");
    			$(".div-hide-group ").hide();
 				$(".td-hide").show();
    			$(".div-hide-rush-buy").show();
    			if(is_qd_show==1){
    			    $(".div-qd-hide-group").hide();
                }
    		}else{
    			$(".div-hide-rush-buy").hide();
    			$(".div-hide-group").show();
				$(".td-hide").show();
                if(is_qd_show==1){
                    $(".div-qd-hide-group").hide();
                }else{
                    $(".div-qd-hide-group").show();
                }
    		}
    	})

    	$.validator.config({
    		rules: {
    	    	isNeedRequired: function() {
    	            return $("#attr_type").val()!=3&&$("#attr_type").val()!=4;
    	        },
    	        groupRequired:function(){
    	        	return $("#attr_type").val()!=4;
    	        },
    	        rushBuyRequired:function(){
    	        	return $("#attr_type").val()==5;
    	        }
    	    }
    	});

    	//var ue = UE.getEditor('desc');

    	//fang  2016-07-13  模版选择的事件
    	$(":radio").click(function(){
    		 var value=$(this).val();
    		 if(value=="1"){
    			 $(".post_fee").attr("name","product.post_fee");
    			 $(".template_id").removeAttr("name");
    		 }
    		 else if(value="2"){
    			 $(".template_id").attr("name","product.template_id");
    			 $(".post_fee").removeAttr("name");
    		 }
    	 });
       })

       var init_state= false;
       $(function(){
       gx.ajax("/system/product/type_json/${product.type_id!}",function(d){
       	  if(d.state){
       		  $("#type_sub_one_id").empty();
       		  for(var i = 0; i<d.data.length;i++){
       			  $("#type_sub_one_id").prepend("<option value='"+d.data[i].id+"'>"+d.data[i].type_name+"</option>")
       		  }
       		  if(init_state==false){
       			  $("#type_sub_one_id").val("${product.type_sub_one_id!}")
       			  $("#type_sub_one_id").change();
       		  }
       	  }
       })

       $("#type_id").change(function(e){
       	gx.ajax("/system/product/type_json/"+$("#type_id").val(),function(d){
       		  if(d.state){
       			  $("#type_sub_one_id").empty();
       			  for(var i = 0; i<d.data.length;i++){
       				  $("#type_sub_one_id").prepend("<option value='"+d.data[i].id+"'>"+d.data[i].type_name+"</option>")
       			  }
    			  $("#type_sub_one_id").change();
       		  }
       	})
       })


       $("#type_sub_one_id").change(function(e){
       	gx.ajax("/system/product/type_json/"+$("#type_sub_one_id").val(),function(d){
       		  if(d.state){
       			  $("#type_sub_two_id").empty();
       			  for(var i = 0; i<d.data.length;i++){
       				  $("#type_sub_two_id").prepend("<option value='"+d.data[i].id+"'>"+d.data[i].type_name+"</option>")
       			  }
       			  if(init_state==false){
       				  $("#type_sub_two_id").val("${product.type_sub_two_id!}")
       			  }
       		  }
       	})
       })

       })
    </script>
<%};%>
<%layout("../layout/_layout_mall.html",{title:'添加商品',jstpl:jstpl,csstpl:csstpl}){ %>
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="tabs-container">
        <ul class="nav nav-tabs">
            <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">配置商品信息</a></li>
        </ul>
        <div class="tab-content">
            <div id="tab-1" class="tab-pane active">
                <div class="panel-body">
                <form  id="form_submit" class="form-horizontal" method="post"  action="/system/product/save">
                <input type="hidden" value="1" name="product.supply_type" >

                <table class="page">

                <tr>
	              <td class="tb_title">商品信息</td>
	              <td>

	                <div class="form-group">
                    <label class="col-sm-2 control-label">销售类型</label>
                    <div class="col-sm-10">
                     <#select attr=' data-rule="required"  id="attr_type"   name="product.attr_type"   tabindex="2"  class="form-control pro_cate"'  value="${product.attr_type!1}"  listdata="${@AppConst.Product_Attr_Type}"  />
                    </div>
                    </div>

	               <div class="form-group">
                      <label class="col-sm-2 control-label">商品类型</label>
                      <div class="col-sm-10">
                      <!-- 商品分类 -->
                      <div class="col-sm-3 margin-negative-15">
                      <#select attr=' data-rule="required"  id="type_id"   name="product.type_id"   tabindex="2"  class="form-control pro_cate width-adaptive" '  value="${product.type_id!+''}"  listdata="${type_list!}" text="type_name" key="id" />
                       </div>
                       <div class="col-sm-3 margin-negative-15">
                       <select  data-rule="required"  id="type_sub_one_id" name="product.type_sub_one_id" class="form-control type_sub_one_id width-adaptive" >
								<option value="">请选择</option>
						</select>
						</div>
						<!--<div class="col-sm-3 margin-negative-15">
                      	<select data-rule="required"  id="type_sub_two_id" name="product.type_sub_two_id" class="form-control type_sub_two_id width-adaptive" >
								<option value="">请选择</option>
						</select>
						</div>
                      <code style="margin-top: 6px" class="clear">请严格按照商铺类型选择商铺类型，如果选择错误可能商品会自动下线！</code>-->
                      </div>
                    </div>



                    <div class="form-group">
                    <label class="col-sm-2 control-label">商品名称</label>
                    <div class="col-sm-10"><input type="text" name="product.product_name" class="form-control pro_name"></div>
                    </div>
	                <div class="form-group prices div-qd-hide-group">
                    <label class="col-sm-2 control-label">商品价格</label>
                    <div class="col-sm-10">
                      <input type="text" name="product.price" class="form-control" /><span class="descp">单独购买价格（元）</span>
                    </div>
                    </div>

	                <div class="form-group prices div-qd-hide-group">
                    <label class="col-sm-2 control-label"></label>
                    <div class="col-sm-10">
                      <input type="text" name="product.market_price" class="form-control" /><span class="descp">市场原价（元）</span>
                    </div>
                    </div>


                    <div class="form-group div-qd-hide-group">
                       <label class="col-sm-2 control-label">商品单位</label>
                       <div class="col-sm-10"><input type="text" name="product.product_tag" class="form-control pro_name"></div>
                    </div>

                    <!-- 预约设置  -->
                    <div class="form-group div-hide-group ">
                    <label class="col-sm-2 control-label">预定设置</label>
                    <div class="col-sm-10">
                      <input type="text" name="product.preordain_front_money"  class="form-control" /><span class="descp">预约定金（元）</span>
                    </div>
                    </div>

                    <div class="form-group div-hide-group">
                    <label class="col-sm-2 control-label"></label>
                    <div class="col-sm-10">
                      <input type="text" name="product.preordain_tail_money"   class="form-control" /><span class="descp">预定尾款（元）</span>
                    </div>
                    </div>

                      <div class="form-group div-hide-rush-buy div-qd-hide-group">
                          <label class="col-sm-2 control-label"></label>
                          <div class="col-sm-10">
                              <input type="text" id="tailTime"  name="product.tail_pay_time" readonly  style="background-color:#FFF !important;"  class="form-control" autocomplete="off"/><span class="descp"><kbd>* 尾款支付时间</kbd></span>
                          </div>
                      </div>

                     <div class="form-group div-hide-rush-buy div-qd-hide-group">
                    <label class="col-sm-2 control-label">预定时限</label>
	                    <div class="col-sm-10">
	                      <input type="text" id="startTime" name="product.preordain_start_time" readonly style="background-color:#FFF !important;" class="form-control" autocomplete="off" /><span class="descp"><kbd>* 预定开始时间</kbd></span>
	                    </div>
                    </div>

                    <div class="form-group div-hide-rush-buy div-qd-hide-group">
                    <label class="col-sm-2 control-label"></label>
	                    <div class="col-sm-10">
	                      <input type="text" id="endTime"  name="product.preordain_end_time" readonly  style="background-color:#FFF !important;"  class="form-control" autocomplete="off"/><span class="descp"><kbd>* 预定结束时间</kbd></span>
	                    </div>
                    </div>




                    <!-- 用户限购 -->
                    <div class="form-group div-qd-hide-group">
                    <label class="col-sm-2 control-label">用户限购数</label>
	                    <div class="col-sm-10">
	                      <input type="text" name="product.restrictions_buy_num" value="0" data-rule='用户限购数:required;digits' class="form-control" /><span class="descp"><kbd>* 默认0为不激活</kbd></span>
	                    </div>
                    </div>


                    <div class="form-group div-qd-hide-group">
                    <label class="col-sm-2 control-label">销量</label>
                    <div class="col-sm-10">
                      <input type="text" name="product.sale_count" maxlength="6" data-rule='销量:required;digits' value="0" class="form-control" /><span class="descp"><kbd>* 前期提升销量可以手动修改</kbd></span>
                    </div>
                    </div>


                    <!-- 拼团设置结束 -->

	                <div class="form-group pro_pic">
                    <label class="col-sm-2 control-label">主要图片</label>
                    <div class="col-sm-10">
                      <ul class="pic clearfloat">
			          <!--
			          <li class="added">
			            <input type="checkbox" name="site.attr_img" value="../image/avatar_07.jpg" checked="checked" />
			            <img class="lazy" src="../image/preview_250x250.jpg" data-src="/static/vendor/img/a3.jpg" /><b></b>
			          </li>
			          -->
			          <li class="btn_add">
			            <img src="${shopinfo.shop_logo!'http://cdn.gexinit.com/image_add.png'}?imageView2/1/w/300/h/300" />
			          </li>
			          </ul>
			          <code class="clear">用于商品列表显示，上传尺寸400*400</code>
                    </div>
                    </div>
	                <div class="form-group pro_banner">
                    <label class="col-sm-2 control-label">切换图片</label>
                    <div class="col-sm-10">
                      <ul class="pic clearfloat">
			          <!--
			          <li class="added">
			            <input type="checkbox" name="site.attr_img" value="../image/avatar_07.jpg" checked="checked" />
			            <img class="lazy" src="../image/preview_250x250.jpg" data-src="/static/vendor/img/a3.jpg" /><b></b>
			          </li>
			          -->
			          <li class="btn_add">
			            <img src="${shopinfo.shop_logo!'http://cdn.gexinit.com/image_add.png'}?imageView2/1/w/300/h/300" />
			          </li>
			          </ul>
			          <code class="clear">用于商品详情顶部切换的图片，推荐上传尺寸750*573</code>
                    </div>
                    </div>
                    <div class="form-group pro_pic2">
                        <label class="col-sm-2 control-label">商品介绍</label>
                        <div class="col-sm-10">
                            <input type="text"  style="width: 100%;"   name="product.introduce_reason"     class="form-control" autocomplete="off"/>
                        </div>
                    </div>
	                <div class="form-group pro_pic2">
                    <label class="col-sm-2 control-label">详情内容</label>
                    <div class="col-sm-10">
                        <textarea placeholder="请填入商品详情内容"  lay-verify="required"  id="introduce" name="product.product_content" style="width: 100%;"></textarea>
                        <!--<ul class="pic clearfloat">
                        &lt;!&ndash;
                        <li class="added">
                          <input type="checkbox" name="site.attr_img" value="../image/avatar_07.jpg" checked="checked" />
                          <img class="lazy" src="../image/preview_250x250.jpg" data-src="/static/vendor/img/a3.jpg" /><b></b>
                        </li>
                        &ndash;&gt;
                        <li class="btn_add">
                          <img src="${shopinfo.shop_logo!'http://cdn.gexinit.com/image_add.png'}?imageView2/1/w/300/h/300" />
                        </li>
                        </ul>
                        <code class="clear">用于商品详情的商品图片,拖动可以排序！</code>-->
                    </div>
                    </div>
              <!--       <div class="form-group">
                    <label class="col-sm-2 control-label">商品详情</label>
                    <div class="col-sm-10">
			          <p class="clear"> <textarea  id="desc" name="product.product_content">${product.product_content!}</textarea></p>
                    </div>
                    </div> -->
                   <!-- <div class="form-group pro_recommend">
                    <label class="col-sm-2 control-label">推荐理由</label>
                    <div class="col-sm-10">
                      <textarea style="max-width: 1000px; width: 60%"  placeholder="描述商品的特性，让用户迅速了解商品的好处" name="product.introduce_reason" class="form-control"></textarea>
                     <p style="left: 60%">500字以内</p>
                    </div>
                    </div>

                     <div class="form-group pro_recommend">
                    <label class="col-sm-2 control-label">分享内容</label>
                    <div class="col-sm-10">
                      <textarea name="product.share_desc" placeholder="分享描述" style="max-width: 1000px; width: 60%"  rows="2" cols="150" value="${product.introduce_reason!}" class="form-control">${product.share_desc!}</textarea>
                      <p style="left: 60%;color: red">100字以内，不能有回车换行</p>
                    </div>
                    </div>-->


                    <div class="form-group pro_percent" hidden>
                    <label class="col-sm-2 control-label">分销比例</label>
                    <div class="col-sm-10"><input type="text" value="0"  name="product.divide_rate" class="form-control" /><span>%</span></div>
                    </div>
	              </td>
                </tr>
                <tr class="div-qd-hide-group">
	              <td class="tb_title">库存规格</td>
	              <td>
                    <div class="form-group pro_norms">
                    <label class="col-sm-2 control-label">商品规格</label>
                    <div class="col-sm-10">
                      <ul>
                      <li><a class="btn btn_additem">增加一项</a></li>
                      </ul>
                      <div class="norm_contt hide">
                      <select multiple>
                      <option></option>
                      <!--
                      <option value="10001">白色</option>
                      <option value="10002">黑色</option>
                      <option value="10003">红色</option>
                      -->
                      </select>
                      </div>
                    </div>
                    </div>
	                <div class="form-group hide2">
                    <label class="col-sm-2 control-label">商家库存</label>
                    <div class="col-sm-10">
                      <table class="store">
                      <tr class="setting"><td colspan="1">批量设置</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td colspan="2"></td></tr>
                      </table>
                      <!--
                      <br>
                      <table class="store">
                      <tr><td>尺寸</td><td>颜色</td><td>款式</td><td>价格（元）</td><td>库存</td><td>商家编码</td><td>销量</td></tr>
                      <tr><td rowspan="6">111</td><td rowspan="3">111</td><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td rowspan="3">111</td><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td rowspan="6">111</td><td rowspan="3">111</td><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td rowspan="3">111</td><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr><td>111</td><td><input type="text" class="tb_price" /></td><td><input type="text" class="tb_store" /></td><td><input type="text" class="tb_proid" /></td><td>0</td></tr>
                      <tr class="setting"><td colspan="3">批量设置</td><td><input type="text" class="set_price" /></td><td><input type="text" class="set_store" /></td><td colspan="2"></td></tr>
                      </table>
                      -->
                    </div>
                    </div>
                      <input type="hidden" value="1" name="product.enable_sku_img">
                      <!-- <div class="form-group">
                       <label class="col-sm-2 control-label">启用缩略图</label>

                       <div class="col-sm-10">
                            <div class="switch">
                           <div class="onoffswitch">
                               <input type="checkbox" ${product.enable_sku_img!1==1?'checked':''}  name="enable_sku_img" value="1" class="onoffswitch-checkbox swt_thumb" id="swt_thumb">
                                <label class="onoffswitch-label" for="swt_thumb">
                                  <span class="onoffswitch-inner"></span>
                                  <span class="onoffswitch-switch"></span>
                              </label>
                           </div>
                           </div>
                       </div>
                    </div>-->
	                <div class="form-group">
                    <label class="col-sm-2 control-label">总库存</label>
                    <!-- fang  2016-08-22 增加 -->
                      <input type="hidden" id="sum_stock" name="product.stock_count"  value="0"   >
                    <div class="col-sm-10"><input type="text" name="stock_count" value="0" class="form-control store_all"></div>
                    </div>
	                <div class="form-group">
                    <label class="col-sm-2 control-label">商家编码</label>
                    <div class="col-sm-10"><input type="text" name="product.product_bn" class="form-control"></div>
                    </div>

                    <div class="form-group">
                    <label class="col-sm-2 control-label">商品排序</label>
                    <div class="col-sm-10"><input type="text" name="product.sort" class="form-control  pro_sort"><span class="descp">从小到大排序,默认0</span></div>
                    </div>


	              </td>
                </tr>
                <tr class="div-qd-hide-group">
	              <td class="tb_title">运费信息</td>
	              <td>
                     <div class="form-group">
                         <!-- 购买多少件商品免运费 -->
                         <label class="col-sm-2 control-label"><input type="radio"  name="buy_count_radio" value="1" checked="checked" />数量</label>
                         <div class="col-sm-10">
                             <input type="text" name="product.buy_count_post_fee"  class="form-control post_fee" value="${product.buy_count_post_fee!0}" >
                             <span class="descp">达到购买数量则免运费,默认0，0不开启免运费</span>
                         </div>
                     </div>
                    <div class="form-group">

                    <!-- 默认包邮 -->

                    <label class="col-sm-2 control-label"><input type="radio"  name="template" value="1" checked="checked" />运费</label>
                    <div class="col-sm-10"><input type="text" name="product.post_fee"  class="form-control post_fee" value="${product.post_fee!0.00}" ></div>
                    </div>
                    <div class="form-group">


                     <label class="col-sm-2 control-label"><input type="radio"  name="template" value="2"  />模版</label>
                     <div class="col-sm-10">
                     <!-- 物流模版 -->
                       <#select attr='   id="type_id" name=""     tabindex="2"  class="form-control template_id" '  value="${product.template_id!+''}"  listdata="${template_list!}" text="template_name" key="id" />
                    </div>
                    </div>
	              </td>
                </tr>
                <tr>
	              <td class="tb_title">上架操作</td>
	              <td>
                    <div class="form-group">
                    <label class="col-sm-2 control-label">是否上架</label>
                    <div class="col-sm-10">
                     	<div class="switch">
                        <div class="onoffswitch">
                           <input type="checkbox" checked="true" name="online_state"  value="1" class="onoffswitch-checkbox" id="online">
                           <label class="onoffswitch-label" for="online">
                               <span class="onoffswitch-inner"></span>
                               <span class="onoffswitch-switch"></span>
                           </label>
                        </div>
                        </div>
                    </div>
                    </div>


                      <div class="form-group">
                          <label class="col-sm-2 control-label">是否推荐商品</label>
                          <div class="col-sm-10">
                              <select id="is_showProduct" name="product.is_hot" class="form-control">
                                  <option value="0">不推荐</option>
                                  <option value="1">推荐</option>
                              </select>
                          </div>
                      </div>

	              </td>
                </tr>
                <tr style="display: none">
	              <td class="tb_title">积分兑换</td>
	              <td>
                    <div class="form-group">
                    <label class="col-sm-2 control-label">是否开启</label>
                    <div class="col-sm-10">
                     	<div class="switch">
                        <div class="onoffswitch">
                           <input type="checkbox" name="jifen_buy_state"  value="1" class="onoffswitch-checkbox swt_jifen" id="swt_jifen">
                           <label class="onoffswitch-label" for="swt_jifen">
                               <span class="onoffswitch-inner"></span>
                               <span class="onoffswitch-switch"></span>
                           </label>
                        </div>
                        </div>
                    </div>
                    </div>
                    <div class="form-group jifen_wrap">
                    <label class="col-sm-2 control-label">积分数量</label>
                    <div class="col-sm-10"><input type="text" class="form-control jifen_num" name="product_jifen" maxlength="10" /></div>
                    </div>
	              </td>
                </tr>
                <tr><td colspan="2" class="btns"><a class="btn  btn_next btn-primary">完成</a></td></tr>
                </table>
                </form>

                </div>
            </div>
        </div>
    </div>

    </div>


    <div class="hide album_contt">

      <div class="menu">
       	<ul>
       	<!--
       	<li data-id="1" class="active">默认分组</li>
       	<li data-id="12">分组 1</li>
       	<li data-id="13">分组 2</li>
       	<li data-id="14">分组 3</li>
       	-->
       	</ul>
      </div>

      <div class="imgs">
       	<ul>
       	<!--
       	<li data-id="35" data-src="/static/vendor/img/a1.jpg" class="selected">
       	  <div>
       	  <img class="lazy" src="/static/weixin/image/lazy_200x200.jpg" data-src="/static/vendor/img/a1.jpg" /><b></b>
       	  </div>
       	  <p>图片名称.jpg</p>
       	</li>
       	<li data-id="35" data-src="/static/vendor/img/a1.jpg">
       	  <div>
       	  <img class="lazy" src="/static/weixin/image/lazy_200x200.jpg" data-src="/static/vendor/img/a1.jpg" /><b></b>
       	  </div>
       	  <p>图片名称.jpg</p>
       	</li>
       	<li data-id="35" data-src="/static/vendor/img/a1.jpg">
       	  <div>
       	  <img class="lazy" src="/static/weixin/image/lazy_200x200.jpg" data-src="/static/vendor/img/a1.jpg" /><b></b>
       	  </div>
       	  <p>图片名称.jpg</p>
       	</li>
       	-->
       	</ul>
       	<p class="clear"></p>
        <a href="javascript:;" class="btn btn_upload">上传</a>
      </div>

      <div class="paginations"></div>

      <div class="footer">
        <p class="tip">提示</p>
        <a href="javascript:;" class="btn btn_sub">选择 <b>0</b> 张，确定</a>
      </div>

    </div>

    <%}%>

    <!-- 相册分组 -->
    <script type="text/html" id="tpl_menu">
	  {{# for(var i=0;i<d.length;i++){ }}
		<li data-id="{{d[i].tag_id}}">{{d[i].tag_name}}<span>{{d[i].count}}</span></li>
	  {{# } }}
	</script>

	<!-- 相册图片 -->
    <script type="text/html" id="tpl_img">
	  {{# for(var i=0;i<d.length;i++){ }}
		<li data-id="{{d[i].file_id}}" data-src="{{d[i].url}}" data-thumb="{{d[i].thumb}}" class="{{d[i].Class}}">
       	  <div>
       	  <img class="lazy" src="/static/vendor/img/lazy_200x200.jpg" data-src="{{d[i].url}}?imageView2/1/w/200/h/200" /><b></b>
		  <p>{{d[i].attr_width+" x "+d[i].attr_heigth}}</p>
       	  </div>
       	  <p>{{d[i].file_name}}</p>
          </div>
        </li>
	  {{# } }}
	</script>

    <!-- 商品主要图片 -->
    <script type="text/html" id="tpl_pro_img1">
        <li class="added">
            <input type="checkbox" name="center_image" value="{{d.url}}" checked="checked" />
            <img class="lazy" src="/static/vendor/img/lazy_200x200.jpg" data-src="{{d.thumb}}" />
            <b><img src="/static/vendor/img/delete2.png" /></b>
        </li>
	</script>

    <!-- 商品切换图片 -->
    <script type="text/html" id="tpl_pro_img2">
	  {{# for(var i=0;i<d.length;i++){ }}
		<li class="added">
		<input type="checkbox" name="banner_img" value="{{d[i].url}}" checked="checked" />
		<img class="lazy" src="/static/vendor/img/lazy_200x200.jpg" data-src="{{d[i].thumb}}" />
		<b><img src="/static/vendor/img/delete2.png" /></b>
		</li>
	  {{# } }}
	</script>

    <!-- 商品详细图片 -->
    <script type="text/html" id="tpl_pro_img3">
	  {{# for(var i=0;i<d.length;i++){ }}
		<li class="added">
		<input type="checkbox" name="image_detail" value="{{d[i].url}}" checked="checked" />
		<img class="lazy" src="/static/vendor/img/lazy_200x200.jpg" data-src="{{d[i].thumb}}" />
		<b><img src="/static/vendor/img/delete2.png" /></b>
		</li>
	  {{# } }}
	</script>
   
   